<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

error_reporting(E_ALL);

ob_start();

define('PROTOCOL','http://');
define('HOST','startup.local');
define('BASE_URL', '/v1/v1/');

define('ROOT_DIR', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
define('LIB_DIR', ROOT_DIR . 'lib' . DIRECTORY_SEPARATOR);
define('H2_DIR', ROOT_DIR . 'h2' . DIRECTORY_SEPARATOR);
define('PACKAGE_DIR', ROOT_DIR . 'package' . DIRECTORY_SEPARATOR);
define('TEMP_DIR', ROOT_DIR . 'temp' . DIRECTORY_SEPARATOR);
define('LOG_DIR', TEMP_DIR . 'log' . DIRECTORY_SEPARATOR);
define('LAYOUT_DIR', ROOT_DIR . 'layout' . DIRECTORY_SEPARATOR);
define('OTHERS_DIR', ROOT_DIR . 'others' . DIRECTORY_SEPARATOR);
set_include_path(get_include_path() . PATH_SEPARATOR . H2_DIR . PATH_SEPARATOR . LIB_DIR . PATH_SEPARATOR . PACKAGE_DIR . PATH_SEPARATOR . OTHERS_DIR);

function __autoload($class_name) {
  require_once str_replace('_', DIRECTORY_SEPARATOR, $class_name) . '.php';
}

Dispatch::execute();
Response::getInstance()->sendHeaders()->sendLayout();

ob_flush();
Log::flush();